import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Sombrilla here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Sombrilla extends Bonos
{
    /**
     * Act - do whatever the Sombrilla wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        // Add your action code here.
        super.sigueRama();
        apareceBalas();
    }    
    /**
     * Carga el numero de balas para que el jugador pueda usarlas
     */
    public void apareceBalas()
    {
        MoveWorld mundo= (MoveWorld)this.getWorld();
        Jugador jug=mundo.getJugador();
        if(isTouching(Jugador.class))
        {
            jug.setBalas(5);   
            mundo.removeObject(this);
        }
    }
}
